<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<script >

	function commit()
	{
		var f = document.forms[0];
		var types = f['type'];
		var tags = '';;
		var checked = false;
		for(var i=0; i<types.length; i++)
		{
		    //alert(types[i].checked);
			if (types[i].checked == true)
			{
				tags = tags + " " + types[i].value;
				checked = true;
			}
		}
		f['tags'].value = tags;
		f.submit();
}

</script>
<body>
	<h1>附近商店</h1>
	<form action="/shop/nearby" method="GET" >
		location（经纬度，逗号分隔）:<input type="text" name="location"/><br/><br/>
		tags类型:
		<input type="checkbox" name="type" value="餐饮"/>餐饮<br/>
		<input type="checkbox" name="type" value="送水"/>送水<br/>
		<input type="checkbox" name="type" value="送米.粮油"/>送米.粮油<br/>
		<input type="checkbox" name="type" value="水果店"/>水果店<br/>
		<input type="checkbox" name="type" value="其他"/>其他<br/><br/>
		
		
		<input type="hidden" name="tags"/>
		
		<input type="button" value="添加" onclick="commit()"/>
	
	</form>
</body>
</html>